import React from 'react';
import { Tag } from 'antd';
import { useTranslation } from 'react-i18next';

const RequestStatus = ({ status, styleProps }) => {
  const { t } = useTranslation();
  const STATUS_LIST = {
    Pending: {
      color: 'processing',
      label: 'pending',
    },
    Approved: {
      color: 'success',
      label: 'approved',
    },
    Rejected: {
      color: 'error',
      label: 'rejected',
    },
    Draft: {
      color: 'default',
      label: 'draft',
    },
  };
  return (
    <>
      {
        status && STATUS_LIST?.[status] &&
        <Tag bordered={false} color={STATUS_LIST?.[status]?.color} style={{ width: '70px', textAlign: 'center', ...styleProps }}>{t(`common.${STATUS_LIST?.[status].label}`)}</Tag >
      }
    </>
  )
};
export default RequestStatus;